package com.chen.pojo.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author chen
 * @version 1.0
 * @date 2025/8/15
 * 返回结果
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    // 返回码
    private Integer code;
    // 异常信息
    private String message;
    // 返回对象
    private Object date;

    public static Result success() {
        return new Result(1, null, null);
    }

    public static Result error(String message) {
        return new Result(0, message, null);
    }
}
